home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / obero / oberon_lib.lha / oberon-a / source1.lha / source / Amiga / MathTrans.mod < prev    next >
Text File  |  1994-08-08  |  3KB  |  158 lines

  1. (**************************************************************************
  2.  
  3.      $RCSfile: MathTrans.mod $
  4.   Description: Interface to mathtrans.library
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.2 $
  8.       $Author: fjc $
  9.         $Date: 1994/08/08 00:50:12 $
  10.  
  11.   $VER: mathtrans_protos.h 1.2 (7.11.90)
  12.   Includes Release 40.15
  13.  
  14.   (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  15.       All Rights Reserved
  16.  
  17.   Oberon-A interface Copyright © 1994, Frank Copeland.
  18.   This file is part of the Oberon-A Interface.
  19.   See Oberon-A.doc for conditions of use and distribution.
  20.  
  21. ***************************************************************************)
  22.  
  23. MODULE MathTrans;
  24.  
  25. (*
  26. ** $C- CaseChk       $I- IndexChk  $L+ LongAdr   $N- NilChk
  27. ** $P- PortableCode  $R- RangeChk  $S- StackChk  $T- TypeChk
  28. ** $V- OvflChk       $Z- ZeroVars
  29. *)
  30.  
  31. IMPORT Exec, SYSTEM;
  32.  
  33.  
  34. (*-- Library Base variable --------------------------------------------*)
  35.  
  36. TYPE
  37.  
  38.   MathTransBasePtr * = CPOINTER TO MathTransBase;
  39.   MathTransBase * = RECORD (Exec.Library) END;
  40.  
  41. CONST
  42.  
  43.   name * = "mathtrans.library";
  44.  
  45. VAR
  46.  
  47.   base *  : MathTransBasePtr;
  48.  
  49.  
  50. (*-- Library Functions ------------------------------------------------*)
  51.  
  52.  
  53. LIBCALL (base : MathTransBasePtr) Atan *
  54.   ( parm [0] : REAL )
  55.   : REAL;
  56.   -30;
  57. LIBCALL (base : MathTransBasePtr) Sin *
  58.   ( parm [0] : REAL )
  59.   : REAL;
  60.   -36;
  61. LIBCALL (base : MathTransBasePtr) Cos *
  62.   ( parm [0] : REAL )
  63.   : REAL;
  64.   -42;
  65. LIBCALL (base : MathTransBasePtr) Tan *
  66.   ( parm [0] : REAL )
  67.   : REAL;
  68.   -48;
  69. LIBCALL (base : MathTransBasePtr) Sincos *
  70.   ( VAR cosResult [1] : REAL;
  71.     parm          [0] : REAL )
  72.   : REAL;
  73.   -54;
  74. LIBCALL (base : MathTransBasePtr) Sinh *
  75.   ( parm [0] : REAL )
  76.   : REAL;
  77.   -60;
  78. LIBCALL (base : MathTransBasePtr) Cosh *
  79.   ( parm [0] : REAL )
  80.   : REAL;
  81.   -66;
  82. LIBCALL (base : MathTransBasePtr) Tanh *
  83.   ( parm [0] : REAL )
  84.   : REAL;
  85.   -72;
  86. LIBCALL (base : MathTransBasePtr) Exp *
  87.   ( parm [0] : REAL )
  88.   : REAL;
  89.   -78;
  90. LIBCALL (base : MathTransBasePtr) Log *
  91.   ( parm [0] : REAL )
  92.   : REAL;
  93.   -84;
  94. LIBCALL (base : MathTransBasePtr) Pow *
  95.   ( power [1] : REAL;
  96.     parm  [0] : REAL )
  97.   : REAL;
  98.   -90;
  99. LIBCALL (base : MathTransBasePtr) Sqrt *
  100.   ( parm [0] : REAL )
  101.   : REAL;
  102.   -96;
  103. LIBCALL (base : MathTransBasePtr) Tieee *
  104.   ( parm [0] : REAL )
  105.   : Exec.SINGLE;
  106.   -102;
  107. LIBCALL (base : MathTransBasePtr) Fieee *
  108.   ( parm [0] : Exec.SINGLE )
  109.   : REAL;
  110.   -108;
  111.  
  112. (* --- functions in V31 or higher (distributed as Release 1.1) ---*)
  113.  
  114. LIBCALL (base : MathTransBasePtr) Asin *
  115.   ( parm [0] : REAL )
  116.   : REAL;
  117.   -114;
  118. LIBCALL (base : MathTransBasePtr) Acos *
  119.   ( parm [0] : REAL )
  120.   : REAL;
  121.   -120;
  122. LIBCALL (base : MathTransBasePtr) Log10 *
  123.   ( parm [0] : REAL )
  124.   : REAL;
  125.   -126;
  126.  
  127.  
  128. (*-- Library Base variable --------------------------------------------*)
  129. (* $L- Address globals through A4 *)
  130.  
  131.  
  132. (*-----------------------------------*)
  133. PROCEDURE* CloseLib ();
  134.  
  135. BEGIN (* CloseLib *)
  136.   IF base # NIL THEN Exec.base.CloseLibrary (base) END;
  137. END CloseLib;
  138.  
  139. (*-----------------------------------*)
  140. PROCEDURE OpenLib * (mustOpen : BOOLEAN);
  141.  
  142. BEGIN (* OpenLib *)
  143.   IF base = NIL THEN
  144.     base :=
  145.       SYSTEM.VAL
  146.         ( MathTransBasePtr,
  147.           Exec.base.OpenLibrary (name, Exec.libraryMinimum));
  148.     IF base # NIL THEN SYSTEM.SETCLEANUP (CloseLib)
  149.     ELSIF mustOpen THEN HALT (100)
  150.     END;
  151.   END;
  152. END OpenLib;
  153.  
  154.  
  155. BEGIN
  156.   base := NIL
  157. END MathTrans.
  158.